﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DefaultMaster.Master" AutoEventWireup="true" CodeBehind="Shopcart.aspx.cs" Inherits="MyWeb.Modules.Products.Shopcart" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function onlyNumbers(evt) {
            var e = event || evt;
            var charCode = e.which || e.keyCode;
            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            return true;
        }
    </script>
    <div class="allcart">
        <div class="title_pro">
            <div class="img_pro">
            </div>
            <div class="titlepro"><h1>Giỏ hàng</h1></div>
        </div>
        <div class="controlcart">
            <asp:Label ID="lblmsg" runat="server" Font-Names="Arial" ForeColor="Red"></asp:Label>
        </div>
        <div class="Cartbox">
            <table class="tablecart" cellpadding="3" cellspacing="5" border="1px">
                <tr class="trHeader">
                    <th colspan="2">
                        Tên sản phẩm
                    </th>
                    <th>
                        Số lượng
                    </th>
                    <th>
                        Giá bán
                    </th>
                    <th>
                        Thành tiền
                    </th>
                    <th>
                    </th>
                </tr>
                <asp:Repeater ID="rptshopcart" runat="server" OnItemCommand="rptshopcart_ItemCommand">
                    <ItemTemplate>
                        <tr>
                            <td style="width: 1px; background: #ccc">
                                <asp:Label ID="lblId" runat="server" Text='<%#Eval("Id").ToString()%>' Visible="false"></asp:Label>
                            </td>
                            <td style="width: 290px; font-weight: bold;">
                                <%#Eval("Name").ToString() %>
                            </td>
                            <td style="width: 100px; text-align: center">
                                <asp:TextBox ID="txtquantity" runat="server" Width="70px" onkeypress="return onlyNumbers();"
                                    Text='<%#Eval("Quantity").ToString() %>'></asp:TextBox>
                            </td>
                            <td style="width: 120px; color: Blue; text-align: right;">
                                <asp:Label ID="lblPrice" runat="server" Text='<%#Format_Price(Eval("Price").ToString())  %>'></asp:Label>
                            </td>
                            <td style="width: 120px; color: Blue; text-align: right;">
                                <asp:Label ID="lblMoney" runat="server" Text='<%#Format_Price(Eval("Money").ToString())%>'></asp:Label>
                            </td>
                            <td style="width: 50px; text-align: center;">
                                <asp:ImageButton ID="imgupdate" runat="server" ImageUrl="~/css/images/refresh.png" ToolTip="Cập nhật giá mới"
                                    CommandName="Update" CommandArgument='<%#Eval("Id")%>' />
                                <asp:ImageButton ID="imgdelete" runat="server" ImageUrl="~/css/images/delete.png" ToolTip="Xóa sản phẩm"
                                    CommandName="Delete" CommandArgument='<%#Eval("Id")%>' />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
                <tr class="trHeader">
                    <td colspan="6" style="text-align: right; color: Black; font-weight: bold; color: Red">
                        Tổng tiền:
                        <asp:Label ID="lblTotal" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
            </table>
        </div>
        <div class="controlcart">
            <asp:LinkButton ID="lbtbackB" runat="server" Text="Mua tiếp" CssClass="back" ToolTip="Mua tiếp"
                OnClick="lbtback_Click"></asp:LinkButton>
            <asp:LinkButton ID="bltpayB" runat="server" Text="Đặt hàng" CssClass="xacnhan" ToolTip="Đặt hàng online"
                OnClick="lbtpayT_Click"></asp:LinkButton>
        </div>
        <asp:Panel ID="pnquestion" runat="server" Visible="true">
            <div class="question InfoMember">
                
            </div>
        </asp:Panel>
    </div>
</asp:Content>
